package com.study.mike.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 自定义系统异常
 *
 * @author zhouhp
 * @date 2021/7/22
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class ApplicationException extends RuntimeException {

    /**
     * 错误码
     */
    protected String code;
    /**
     * 错误信息
     */
    protected String msg;

    public ApplicationException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ApplicationException(String code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }
}
